package work823;

import java.net.ServerSocket;
import java.net.Socket;

public class work4Server {
  public static void main(String[] args) {
    ServerSocket serverSocket = null;
    try {
      serverSocket = new ServerSocket(8888);
      System.out.println("服务器启动。。。");
      while (true){
        Socket socket = serverSocket.accept();
        System.out.println(socket.getInetAddress().getHostAddress() + ":" + socket.getPort() + "已连接");
        new work4Thread(socket).start();
      }
    }catch (Exception e){
      e.printStackTrace();
    }
  }
}
